﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_PAYINSURANCE_C69AHD
    {
        private Guid m_C69aHDID;
        private string m_Condition;
        private string m_Description;
        private string m_EmployeeCode;
        private string m_EmployeeName;
        private int m_HomeAbsent;
        private decimal m_Money;
        private Guid m_PayInsuranceTableListID;
        private int m_ProgressAbsent;
        private int m_PublicAbsent;
        private string m_SocialInsuranceCode;

        public HRM_PAYINSURANCE_C69AHD()
        {
            this.m_C69aHDID = Guid.Empty;
            this.m_PayInsuranceTableListID = Guid.Empty;
            this.m_EmployeeCode = "";
            this.m_EmployeeName = "";
            this.m_SocialInsuranceCode = "";
            this.m_Condition = "";
            this.m_ProgressAbsent = 0;
            this.m_HomeAbsent = 0;
            this.m_PublicAbsent = 0;
            this.m_Money = 0M;
            this.m_Description = "";
        }

        public HRM_PAYINSURANCE_C69AHD(Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            this.m_C69aHDID = C69aHDID;
            this.m_PayInsuranceTableListID = PayInsuranceTableListID;
            this.m_EmployeeCode = EmployeeCode;
            this.m_EmployeeName = EmployeeName;
            this.m_SocialInsuranceCode = SocialInsuranceCode;
            this.m_Condition = Condition;
            this.m_ProgressAbsent = ProgressAbsent;
            this.m_HomeAbsent = HomeAbsent;
            this.m_PublicAbsent = PublicAbsent;
            this.m_Money = Money;
            this.m_Description = Description;
        }

        public string Delete()
        {
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { this.m_C69aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Delete", myParams, myValues);
        }

        public string Delete(Guid C69aHDID)
        {
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlConnection myConnection, Guid C69aHDID)
        {
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C69AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlTransaction myTransaction, Guid C69aHDID)
        {
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C69AHD_Delete", myParams, myValues);
        }

        public bool Exist(Guid C69aHDID)
        {
            bool hasRows = false;
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C69AHD_Get", myParams, myValues);
            if (reader != null)
            {
                hasRows = reader.HasRows;
                reader.Close();
                helper.Close();
                reader = null;
            }
            return hasRows;
        }

        public string Get(Guid C69aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C69AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C69aHDID = reader.GetGuid(reader.GetOrdinal("C69aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlConnection myConnection, Guid C69aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myConnection, "HRM_PAYINSURANCE_C69AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C69aHDID = reader.GetGuid(reader.GetOrdinal("C69aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlTransaction myTransaction, Guid C69aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C69aHDID" };
            object[] myValues = new object[] { C69aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myTransaction, "HRM_PAYINSURANCE_C69AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C69aHDID = reader.GetGuid(reader.GetOrdinal("C69aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_HomeAbsent = Convert.ToInt32(reader["HomeAbsent"]);
                    this.m_PublicAbsent = Convert.ToInt32(reader["PublicAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetList()
        {
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C69AHD_GetList");
        }

        public DataTable GetList(Guid PayInsuranceTableListID)
        {
            string[] myParams = new string[] { "@PayInsuranceTableListID" };
            object[] myValues = new object[] { PayInsuranceTableListID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C69AHD_GetListByPayInsuranceTableList", myParams, myValues);
        }

        public string Insert()
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { this.m_C69aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { this.m_C69aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C69AHD_Insert", myParams, myValues);
        }

        public string Insert(Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlConnection myConnection, Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C69AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction, Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C69AHD_Insert", myParams, myValues);
        }

        public string NewID()
        {
            return SqlHelper.GenCode("HRM_PAYINSURANCE_C69AHD", "C69aHDID", "CV");
        }

        public string Update()
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { this.m_C69aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_ProgressAbsent, this.m_HomeAbsent, this.m_PublicAbsent, this.m_Money, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Update", myParams, myValues);
        }

        public string Update(Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C69AHD_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C69AHD_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, Guid C69aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, int ProgressAbsent, int HomeAbsent, int PublicAbsent, decimal Money, string Description)
        {
            string[] myParams = new string[] { "@C69aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@ProgressAbsent", "@HomeAbsent", "@PublicAbsent", "@Money", "@Description" };
            object[] myValues = new object[] { C69aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, ProgressAbsent, HomeAbsent, PublicAbsent, Money, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C69AHD_Update", myParams, myValues);
        }

        [Category("Primary Key"), DisplayName("C69aHDID")]
        public Guid C69aHDID
        {
            get
            {
                return this.m_C69aHDID;
            }
            set
            {
                this.m_C69aHDID = value;
            }
        }

        [Category("Column"), DisplayName("Condition")]
        public string Condition
        {
            get
            {
                return this.m_Condition;
            }
            set
            {
                this.m_Condition = value;
            }
        }

        [DisplayName("Description"), Category("Column")]
        public string Description
        {
            get
            {
                return this.m_Description;
            }
            set
            {
                this.m_Description = value;
            }
        }

        [DisplayName("EmployeeCode"), Category("Column")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [Category("Column"), DisplayName("EmployeeName")]
        public string EmployeeName
        {
            get
            {
                return this.m_EmployeeName;
            }
            set
            {
                this.m_EmployeeName = value;
            }
        }

        [Category("Column"), DisplayName("HomeAbsent")]
        public int HomeAbsent
        {
            get
            {
                return this.m_HomeAbsent;
            }
            set
            {
                this.m_HomeAbsent = value;
            }
        }

        [Category("Column"), DisplayName("Money")]
        public decimal Money
        {
            get
            {
                return this.m_Money;
            }
            set
            {
                this.m_Money = value;
            }
        }

        [DisplayName("PayInsuranceTableListID"), Category("Column")]
        public Guid PayInsuranceTableListID
        {
            get
            {
                return this.m_PayInsuranceTableListID;
            }
            set
            {
                this.m_PayInsuranceTableListID = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_PAYINSURANCE_C69AHD";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [DisplayName("ProgressAbsent"), Category("Column")]
        public int ProgressAbsent
        {
            get
            {
                return this.m_ProgressAbsent;
            }
            set
            {
                this.m_ProgressAbsent = value;
            }
        }

        [Category("Column"), DisplayName("PublicAbsent")]
        public int PublicAbsent
        {
            get
            {
                return this.m_PublicAbsent;
            }
            set
            {
                this.m_PublicAbsent = value;
            }
        }

        [Category("Column"), DisplayName("SocialInsuranceCode")]
        public string SocialInsuranceCode
        {
            get
            {
                return this.m_SocialInsuranceCode;
            }
            set
            {
                this.m_SocialInsuranceCode = value;
            }
        }
    }
}

